Skip to content

feat: add workspace hydration primitives#131

Merged
radu-mocanu merged 1 commit into
mainfrom
feat/runtime-workspace-hydration
Jun 24, 2026
Merged

feat: add workspace hydration primitives#131
radu-mocanu merged 1 commit into
mainfrom
feat/runtime-workspace-hydration

Conversation

@radu-mocanu

@radu-mocanu radu-mocanu commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add uipath.runtime.workspace: Workspace, WorkspaceRegistryStore, WorkspaceHydrator, and HydrationRuntime/HydrationPolicy for persisting an agent's working directory across executions via job attachments
  • workspace files are stored as Orchestrator attachments and restored on the next run, so they survive suspend/resume
  • attachment names are kept slash-free (reversibly encoded) so files in subdirectories round-trip correctly
  • deletes propagate: a file removed locally is dropped from the registry and not restored (for harnesses that will support file deletion)

depends on UiPath/uipath-python#1744

@radu-mocanu radu-mocanu requested a review from a team as a code owner June 23, 2026 16:27
Copilot AI review requested due to automatic review settings June 23, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces workspace hydration primitives to persist a runtime’s working directory across executions by storing workspace files as Orchestrator job attachments and restoring them on subsequent runs (supporting suspend/resume scenarios).

Changes:

  • Added a new uipath.runtime.workspace package containing Workspace, WorkspaceRegistryStore, WorkspaceHydrator, and the HydrationRuntime wrapper with HydrationPolicy.
  • Implemented reversible slash-free attachment naming to round-trip nested workspace paths, plus registry merging to propagate local deletions.
  • Added a new test suite covering hydrate/dehydrate behavior, registry reconstruction from parent jobs, attachment name encoding, and persistence policies.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uv.lock Updates locked dependency versions (notably uipath-core) and lock options.
pyproject.toml Bumps project version and updates the uipath-core dependency constraint.
src/uipath/runtime/__init__.py Re-exports workspace hydration primitives as part of the public runtime API.
src/uipath/runtime/workspace/__init__.py Defines the public surface of the new workspace subpackage (__all__).
src/uipath/runtime/workspace/workspace.py Adds workspace lifecycle management (create, dispose).
src/uipath/runtime/workspace/registry_store.py Adds storage-backed registry persistence for attachment metadata.
src/uipath/runtime/workspace/hydrator.py Implements attachment-backed hydrate/dehydrate, registry discovery from jobs, and path encoding/validation.
src/uipath/runtime/workspace/hydration.py Adds the runtime wrapper (HydrationRuntime) and policy-based persistence behavior.
tests/workspace/test_workspace_hydration.py Adds tests for the new workspace hydration and persistence behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/uipath/runtime/workspace/hydrator.py
Comment thread src/uipath/runtime/workspace/hydration.py
@radu-mocanu radu-mocanu force-pushed the feat/runtime-workspace-hydration branch from ee09cb7 to 81234fe Compare June 23, 2026 16:34
@radu-mocanu radu-mocanu force-pushed the feat/runtime-workspace-hydration branch from 81234fe to e853dbf Compare June 23, 2026 16:38
@sonarqubecloud

Copy link
Copy Markdown

@radu-mocanu radu-mocanu merged commit ed21bc7 into main Jun 24, 2026
95 checks passed
viswa-uipath added a commit that referenced this pull request Jun 27, 2026
Adds the audit pipeline that records governance evaluations: an
AuditManager that fans out per-evaluation records to registered sinks
(console + traces), with per-instance lifecycle (one ThreadPoolExecutor
+ atexit hook keyed via a WeakSet of live managers — same shape the
later GuardrailCompensator slice reuses).

Sinks
-----

- Console sink for local development and CLI runs.
- Traces sink that emits an OTel span per evaluation; severity is
  mapped from the matched rule's enforcement mode (audit / enforce /
  guardrail_fallback) so downstream traces UIs can filter by it.

Companion changes pulled in via the main-merge on this branch
-------------------------------------------------------------

This branch was kept in sync with main during review; the diff
therefore includes the following work that originated in other PRs and
will already be merged by the time this lands:

- Workspace hydration primitives (hydration, hydrator, registry_store,
  workspace; from PR #131).
- ``execution_source`` derived field on the runtime context (from
  PR #132).

Co-Authored-By: Aditi Kumari <aditi.kumari@uipath.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
viswa-uipath added a commit that referenced this pull request Jun 27, 2026
Adds the audit pipeline that records governance evaluations: an
AuditManager that fans out per-evaluation records to registered sinks
(console + traces), with per-instance lifecycle (one ThreadPoolExecutor
+ atexit hook keyed via a WeakSet of live managers — same shape the
later GuardrailCompensator slice reuses).

Sinks
-----

- Console sink for local development and CLI runs.
- Traces sink that emits an OTel span per evaluation; severity is
  mapped from the matched rule's enforcement mode (audit / enforce /
  guardrail_fallback) so downstream traces UIs can filter by it.

Companion changes pulled in via the main-merge on this branch
-------------------------------------------------------------

This branch was kept in sync with main during review; the diff
therefore includes the following work that originated in other PRs and
will already be merged by the time this lands:

- Workspace hydration primitives (hydration, hydrator, registry_store,
  workspace; from PR #131).
- ``execution_source`` derived field on the runtime context (from
  PR #132).

Co-Authored-By: Aditi Kumari <aditi.kumari@uipath.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
viswa-uipath added a commit that referenced this pull request Jun 27, 2026
Adds the audit pipeline that records governance evaluations: an
AuditManager that fans out per-evaluation records to registered sinks
(console + traces), with per-instance lifecycle (one ThreadPoolExecutor
+ atexit hook keyed via a WeakSet of live managers — same shape the
later GuardrailCompensator slice reuses).

Sinks
-----

- Console sink for local development and CLI runs.
- Traces sink that emits an OTel span per evaluation; severity is
  mapped from the matched rule's enforcement mode (audit / enforce /
  guardrail_fallback) so downstream traces UIs can filter by it.

Companion changes pulled in via the main-merge on this branch
-------------------------------------------------------------

This branch was kept in sync with main during review; the diff
therefore includes the following work that originated in other PRs and
will already be merged by the time this lands:

- Workspace hydration primitives (hydration, hydrator, registry_store,
  workspace; from PR #131).
- ``execution_source`` derived field on the runtime context (from
  PR #132).

Co-Authored-By: Aditi Kumari <aditi.kumari@uipath.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants